﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using LeMigue.TeamPortal.Base.Mvc;

namespace LeMigue.TeamPortal.Base.Helpers
{
    public static class ResolveResourcesPathHelper
    {
        public static string ResourcesPath(this HtmlHelper helper, string path)
        {

            return String.Format("{0}/{1}",helper.ViewContext.HttpContext.Request.ApplicationPath, path);
        }

        public static string ResourcesPath(this HtmlHelper helper, string plugin, string path)
        {

            return String.Format("{0}/{1}/{2}/{3}", helper.ViewContext.HttpContext.Request.ApplicationPath, TeamPortalPlugins.PluginPath, plugin, path);

        }

        public static string BuildLink(this HtmlHelper helper, string text, string controler, string action){
            return String.Format("<a href=\"{1}/{2}/{3}\">{0}</a>", text, helper.ViewContext.HttpContext.Request.ApplicationPath, controler, action);
        }
    }
}
